import React, { useState } from 'react';
import { Map, Provider, Marker, APILoader, InfoWindow, useInfoWindow } from '@uiw/react-baidu-map';
import styles from "./Bmap.module.scss";
const Demo = () => {


  const [isOpen, setIsOpen] = useState(true);

  const [visiable, setVisiable] = useState(true);




  //const icon = new BMap.Icon('http://developer.baidu.com/map/jsdemo/img/fox.gif', new BMap.Size(50, 50));
  return (
    <div className='mx-auto w-1200px mt-10'>
      <APILoader akay="f5PbVvMcGDO6RfDEykHh2GtdqAnWhH1G">
        <Provider>
          <Map center={{ lng: 108.94468, lat: 34.236724 }} widget={['NavigationControl']} zoom={15} style={{ height: 350, fontSize: '18px' }}>

            <Marker position={{ lng: 108.94468, lat: 34.236724 }} type='red1' />

            <InfoWindow
              visiable={visiable}
              isOpen={isOpen}
              onClose={() => {

              }}
              position={{ lng: 108.94468, lat: 34.236724 }}
              content={'陕西省西安市碑林区友谊东路81号泰华世纪新城B座603号'}
              title="地址信息"
            />

          </Map>
        </Provider>
      </APILoader>
    </div>
  );
};

export default Demo;